#ifndef __ANO_PROGRAMCTRL_USER_H
#define __ANO_PROGRAMCTRL_USER_H

//==锟斤拷锟斤拷

#include "Ano_FcData.h"
#include "stdbool.h"

//==锟斤拷锟斤拷
typedef struct
{
	//
	float vel_cmps_set_h[2];
	float vel_cmps_set_w[2];
	float vel_cmps_set_ref[2];
	//
	float vel_cmps_set_z;
	float pal_dps_set;
}_pc_user_st;
extern _pc_user_st pc_user;

//==锟斤拷锟斤拷锟斤拷锟斤拷


//==锟斤拷锟斤拷锟斤拷锟斤拷

//static
extern int16_t filtered_set_coordinate_data_x;
extern int16_t filtered_set_coordinate_data_y;


//public
void Program_Ctrl_User_Set_HXYcmps(float hx_vel_cmps,float hy_vel_cmps);
void Program_Ctrl_User_Set_Zcmps(float z_vel_cmps);
void Program_Ctrl_User_Set_YAWdps(float yaw_pal_dps);


typedef struct
{
    float data_temp[20];
    uint8_t length;
    float s2;
}s2_t;

typedef struct
{
    uint8_t sdk_alt_step;
    uint8_t sdk_yaw_step;
    float sdk_yaw_d_angle;
    uint16_t sdk_yaw_angle_count;
    float sdk_alt_out;
    float sdk_velocity_x;
    float sdk_velocity_y;
    bool sdk_auto_takeoff;

    int16_t coordinate_x;//x坐标
    int16_t coordinate_y;//y坐标

    float yaw_mark;
    float *yaw_pos_ptr;
} sdk_manager_t;


extern sdk_manager_t sdk_manager;


void sdk_init(void);


void sdk_target_set(float x_pos, float y_pos, float velocity_x, float velocity);

void sdk_velocity_set(float x, float y);

void sdk_round_set(float distance, float angle, int R_);

bool sdk_alititude_set(float distance);

void sdk_takeoff(float alititude);

void sdk_land(void);

void sdk_lock(void);

void sdk_unlock(void);

void sdk_velocity_y_set(float y);

void sdk_velocity_x_set(float x);

void sdk_update(float dt);


void sdk_reset_Location(void);


void sdk_velocity_reset(void);

void sdk_yaw_reset(void);

void sdk_yaw_target(float yaw);
bool is_yaw_set_compleate(void);

void sdk_yaw_little(float yaw);
bool sdk_yaw_set(float angle);
void sdk_yaw_stop(void);


bool is_pos_y_set_compleate(float max_err);
bool is_pos_x_set_compleate(float max_err);
bool is_pos_set_compleate(float max_err);


uint8_t sdk_pos_set(int16_t x,int16_t y);
uint8_t sdk_pos_set_x(int16_t x);
uint8_t sdk_pos_set_y(int16_t y);

bool yaw_round_180(void);
void sdk_update_position(void);
void sdk_reset_position(void);

void filtered_set_coordinate_data();

#endif
